﻿using System;
using System.Linq;

class CheckIfEqual
{
    static void Main(string[] args)
    {
        Console.Write("Enter the n for the first array: ");
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine();
        Console.Write("Enter the m for the second array: ");
        int m = int.Parse(Console.ReadLine());

        int[] firstArray = new int[n];
        int[] secondArray = new int[m];
        int firstLength = firstArray.Length;
        int secondLength = secondArray.Length;
        bool haveEqualLength = true;

        for (int index = 0; index < n; index++)
        {
            firstArray[index] = int.Parse(Console.ReadLine());
        }


        for (int index = 0; index < m; index++)
        {
            secondArray[index] = int.Parse(Console.ReadLine());
        }

        if (firstLength != secondLength)
        {
            haveEqualLength = false;
            Console.WriteLine("The two arrays are not equal:" + haveEqualLength);
        }
        else
        {
            for (int i = 0; i < firstLength; i++)
            {
                for (int j = 0; j < secondLength; j++)
                {
                    if (firstArray[i] == secondArray[j])
                    {
                        haveEqualLength = true;
                    }
                    else
                    {
                        haveEqualLength = false;
                    }
                }
            }
            Console.WriteLine("The two arrays are equal: " + haveEqualLength);


        }
    }

}

